<html ng-app="diandanbao" class="ng-scope">
<head>
    <style type="text/css">@charset "UTF-8";[ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\:form{display:block;}</style>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta content="telephone=no" name="format-detection">
    <link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
    <title>预订订单</title>
    <link data-turbolinks-track="true" href="{RES}/mobile/{php echo $this->cur_tpl}/assets/diandanbao/weixin.css" media="all" rel="stylesheet">
    <style type="text/css">@media screen{.smnoscreen {display:none}} @media print{.smnoprint{display:none}}</style></head>
<body>
<div ng-view="" style="height: 100%;" class="ng-scope">
    <div class="ddb-nav-header ng-scope" common-header="">
        <div class="nav-left-item" onclick="location.href='{php echo $this->createMobileUrl('detail', array('id' => $storeid, 'mode' => 3), true)}';"><i class="fa fa-angle-left"></i></div>
        <div class="header-title ng-binding">预订时间</div>
    </div>
    <div class="section ng-scope" style="margin-bottom: 0px;">
        <div class="list-item  ddb-form-control custom-form-element ng-scope">
            <div class="ddb-form-label ng-binding">预订时间</div>
            <select class="ng-valid ng-scope ng-dirty ng-valid-parse ng-touched" onchange="changeDate(this);">
                {loop $dates $date}
                <option value="{$date}" {if $date==$select_date}selected="selected"{/if}>{$date}</option>
                {/loop}
            </select>
        </div>
    </div>
    <div class="main-view ng-scope" id="time-points-index" style="padding-top: 1px;">
        {if !empty($store['reservation_announce'])}
        <div class="notification-section">
            <div class="notice">
                <i class="fa fa-volume-up red"></i>
                <marquee behavior="scroll" scrollamount="1" scrolldelay="1">{$store['reservation_announce']}</marquee>
            </div>
        </div>
        {/if}
        <div class="section"></div>
        {loop $tablezones $item}
        <div class="ng-scope">
        <div class="table-zone-item">
            <div class="name ng-binding">{$item['title']}</div>
            <div class="min_reservation_price ng-binding">￥{$item['limit_price']}起订</div>
            <div class="time-points">
                {loop $list $row}
                {if $item['id'] == $row['tablezonesid']}
                <span class="button time-point ng-binding ng-scope {if $cur_date == $select_date}{if $cur_time < $row['time']}border-red{/if}{else}border-red{/if}" {if $cur_date == $select_date}{if $cur_time < $row['time']}onclick="selectTime({$row['id']});"{/if}{else}onclick="selectTime({$row['id']});"{/if}>{$row['time']}</span>
                {/if}
                {/loop}
            </div>
            <div class="space-12"></div>
        </div>
        </div>
        {/loop}
    </div>
</div>
<input type="hidden" id="select_date" name="select_date" value="{$select_date}">
<script type="text/javascript" src="../addons/weisrc_dish/template/js/2/jQuery.js"></script>
<script>
    function changeDate(obj) {
        var date = obj.value;
        var url = "{php echo $this->createMobileUrl('ReservationIndex', array('storeid' => $storeid), true)}" + "&selectdate=" + date;
        window.location.href = url;
    }

    function selectTime(id) {
        var select_date = $("#select_date").val();
        var url = "{php echo $this->createMobileUrl('ReservationDetail', array('storeid' => $storeid), true)}" + "&selectdate=" + select_date + "&timeid=" + id;
        window.location.href = url;
    }
</script>
</body>
</html>